package org.ceteca.explica.core.util;

import java.util.Comparator;

import org.ceteca.explica.core.common.BaseVO;



/**
 * @author Juan C. Díaz (juancarlosdiaz@ceteca.net) <br>
 *         Copyright (c) 2009 Fundación Centro Tecnolóxico da Carne
 * 
 * <br>
 * <br>
 *         This program is free software: you can redistribute it and/or modify
 *         it under the terms of the GNU General Public License as published by
 *         the Free Software Foundation, either version 3 of the License, or (at
 *         your option) any later version. <br/>
 *         This program is distributed in the hope that it will be useful, but
 *         WITHOUT ANY WARRANTY 
 *         <br>without even the implied warranty of
 *         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *         General Public License for more details. <br/>
 *         You should have received a copy of the GNU General Public License
 *         along with this program. If not, see <http://www.gnu.org/licenses/>.
 * 
 */
public class BaseVObyIdComparator implements Comparator<BaseVO>{

	public int compare(BaseVO o1, BaseVO o2) {
		
		if (o1==null && o2==null)
			return 0;
		if (o1==null)
			return 1;
		if (o2==null)
			return -1;
		Long id1=new Long(o1.getInternalId());
		Long id2= new Long(o2.getInternalId());
		return id1.compareTo(id2);
	}


}
